﻿using System.Collections.Generic;
using HouseKeeperCore.Hierarchical;
using HouseKeeperCore.Elemental;

namespace BillSplitter
{
    /// <summary>
    ///  A class that represents an entity that uses services and pays bills
    /// </summary>
    public class Billee : TaggedEntity, IConsumer
    {
        #region Properties

        #region Implementation of IConsumer

        /// <summary>
        ///  All the usage the billee is currently making
        /// </summary>
        public IEnumerable<IUsage> Consumption
        {
            get { throw new System.NotImplementedException(); }
        }

        #endregion


        #endregion

        #region Constructors

        /// <summary>
        ///  Instantiates a billee
        /// </summary>
        public Billee()
            : base(BillHelper.EntityIdGenerator.Assign())
        {
        }

        /// <summary>
        ///  Finalises a billee
        /// </summary>
        ~Billee()
        {
            Dispose(false);
        }

        #endregion

        #region Methods

        /// <summary>
        ///  Disposes of unmanaged resources
        /// </summary>
        protected override void DisposeUnmanaged()
        {
            BillHelper.EntityIdGenerator.Unassign(Id);

            base.DisposeUnmanaged();
        }
        
        #endregion
    }
}
